<div class="cateadd">
	<form action="<?php echo url('category/add');?>" method="post" id="addForm">
		<table>
			<tr>
				<td width="100" class="inputtxt" align="right"><span>分类名称</span></td>
				<td align="left">
					<input type="text" class="required" name="cate[title]" value="" />&nbsp;&nbsp;&nbsp;
					<span style="color:red;">*</span>
				</td>
			</tr>
			<tr>
				<td class="inputtxt" align="right"><span>上级分类</span></td>
				<td align="left">
					<?php echo fetch('categorySelect',array('name'=>'cate[parentID]','type'=>$type,'show'=>'1'));?>
				</td>
			</tr>
			<tr>
				<td class="inputtxt" align="right"><span>分类排序</span></td>
				<td align="left"><input type="text"  name="cate[sortID]" value="" /></td>
			</tr>
			<tr>
				<td align="right">图片:</td>
				<td align="left" class="magin"><?php echo fetch('uploadImg',array('limit'=>1));?></td>
			</tr>
			<tr>
				<td class="inputtxt" align="right"><span>分类描述</span></td>
				<td align="left"><textarea name="cate[description]" cols="50" rows="6"></textarea></td>
			</tr>
			<tr><td colspan="2" align="right"><input type="submit" value="添加" id="catesub" /></td></tr>
		</table>
		<input type="hidden" name="type" value="<?php echo $type;?>" />
	</form>
</div>
<script type="text/javascript">
$(document).ready(function(){
	submitForm("#addForm",{
		dataType:'json',
		success:function(data){
				if(data.s=='1'){
					location.href="<?php echo url('category/index?type=');?>"+data.i;
				}else{
					alert(data.i);
				}
			},
	});
});
</script>
